# encoding=utf-8
# 载入模块
import uuid
from RedisOper import *


class ListOper():
    @staticmethod
    def getlist(token, product_id):
        user_id = None
        permit = False
        code = -1
        data = []
        msg = ''
        g_login, g_user_id = RedisOper.get_userid_bytoken(token)
        if g_login:
            print('token验证成功')
            # 1 select sid as role_id from t_user_role where user_id='test'
            #   and product_id ='1'
            # 2 select right_id from t_role_right where role_id in ()
            # 3 select module_id,product_id,right_content from t_right where
            # sid in ('xxx','yyyy')  and product_id =''

            ret = {}
            post_data = {}
            post_data['user_id'] = [g_user_id]
            post_data['product_id'] = [product_id]
            # ret = isel(SearchInfo, ret, post_data, querycolname='user_id', querycolname2='product_id', sort='desc')
            return ret
        else:
            print('token验证失败')
        return permit, user_id, code, data, msg

